﻿using System.Security.Principal;

namespace UltimateNavigationFramework.Authorisation
{
    public interface IAuthorisationRuleElement
    {
        /// <summary>
        /// Indicates whether the principal is allowed by this rule element.
        /// </summary>
        /// <param name = "principal">The principal to check.</param>
        /// <returns>True if the principal is allowed.  False otherwise.</returns>
        bool IsAllowed(IPrincipal principal);

        /// <summary>
        /// Indicates whether the principal is denied by this rule element.
        /// </summary>
        /// <param name = "principal">The principal to check.</param>
        /// <returns>True if the principal is denied.  False otherwise.</returns>
        bool IsDenied(IPrincipal principal);
    }
}
